# This code is part of the MWP System
# Copyright (c) 2012 Benjamin Lubin (blubin@bu.com) 
# Published under and subject to the GPLv2 license available at http://www.gnu.org/licenses/gpl-2.0.html

'''
Created on Dec 18, 2012
@author: shitake
'''

from frontend.roleApplication import RoleApplication;
from frontend.form import Type;
from unique import UNIQUE

class CaseManagerApplication(RoleApplication):
    """ The Case Manager User Interface """

    def __init__(self):
        super(CaseManagerApplication, self).__init__("RentSubsidy"+UNIQUE, "CaseManager");
        self.register_transition_step("Calculate", self.case_manager_calculation_form_creator, name_fields=["sequence", "FirstName", "LastName", "EarnedIncome", "CashBenefits", "RentPayable", "totalincome", "estsubsidy"]);

    def case_manager_calculation_form_creator(self, stepname, form):
        form.add_task_label(fields=["FirstName", "LastName", "EarnedIncome", "CashBenefits", "RentPayable", "totalincome"]);
        estsubsidy=float(form.task.get_field("estsubsidy"))
        form.add_field(Type.CURRENCY, "Subsidy", labeltext="Subsidy", initial=estsubsidy);
        

if __name__ == '__main__':
    app = CaseManagerApplication();
    app.MainLoop();